package com.zzty.txj1.controller;

import com.zzty.txj1.entity.Sport;
import com.zzty.txj1.service.SportService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/img")
public class ImgController {
    private static final Logger logger = LoggerFactory.getLogger(ImgController.class);

    @Autowired
    private SportService sportService;

    @RequestMapping(value = "/uploadImg1", method = RequestMethod.POST)
    public Integer uploadImg1(Sport sport) {
        Integer count = sportService.updateImg1(sport);
        logger.info("Img--controller ============ uploadImg1 count :" + count);
        return count;
    }

    @RequestMapping(value = "/uploadImg2", method = RequestMethod.POST)
    public Integer uploadImg2(Sport sport) {
        Integer count = sportService.updateImg2(sport);
        logger.info("Img--controller ============ uploadImg2 count :" + count);
        return count;
    }
}
